@extends('home.base.header')

@include('home.top')

@section('content')


<!--双12 header增加背景图的 字体颜色改变-->

<!-- 20130904-热门板-start -->
<div class="hot-board">

    <!--ads start-->
    <div class="ec-slider" id="index_slider" style="width: 1361px; height: 448px;">
    <ul class="ec-slider-list" style="width: 100%; height: 448px;position: relative;">
    	<div class="box" id="box">
			<div class="list" id="list">
				<li>1</li>
				<li>2</li>
				<li>3</li>
				<li>4</li>
				<li>5</li>
                <li>6</li>
                <li>7</li>
			</div>

			<div class="pic" id="pic">
                @foreach ($l as $v)
                    <li class="ec-slider-item"  style="background:url('{{ asset('uploads/'.$v->cLinks) }}') 50% 0px no-repeat ;">
                        <div style="width:100%;" class="ec-slider-item-img">
                            <a style="width:100%;height:448px;display:block;" href="#" target="_blank"></a>
                        </div>
                    </li>
                @endforeach
			</div>
		</div>
    </ul>
</div>
<script type="text/javascript">
	var pic = document.getElementById("pic"),
		picLi = pic.getElementsByTagName("li"),
		list = document.getElementById("list"),
		listLi = list.getElementsByTagName("li"),
		timer = null;
	var num = 0,
		box = document.getElementById("box");
    /*for (var i = 0; i < listLi.length; i++) {
        listLi[i].style.background="#C81118";

        listLi[i].style.display = "block";
    };*/
	//向左向右公共事件
	function leftright(){
		for(var k =0;k<picLi.length;k++){
			picLi[k].style.display="none";
			listLi[k].style.background="#494949";
		}
		picLi[num].style.display="block";
		listLi[num].style.background="#C81118";
	}
	//轮播
	function lunbo(){
		num++;
		if(num>=picLi.length){
			num=0;
		}
		leftright();
	}
	//鼠标滑过圆点的时候出发
	for(var i = 0 ; i<=picLi.length-1;i++){
		listLi[i].index=i;
		listLi[i].onmouseover = function(){
			for(var i = 0;i<picLi.length;i++){
				picLi[i].style.display="none";
				listLi[i].style.background="#494949";
			}
			picLi[this.index].style.display="block";
			listLi[this.index].style.background="#C81118";
			num = this.index;
		}
		listLi[i].onmouseout = function(){
			listLi[this.index].style.background="#C81118";
		}
	}
	timer=setInterval(lunbo,2000);
	box.onmouseout=function(){
		timer=setInterval(lunbo,2000);
	}
	box.onmouseover=function(){
		clearInterval(timer);
	}
</script>
    <!--ads end-->
</div><!-- 20130904-热门板-end -->

 <!--//20161123 弹出框-->
            

<!-- 20160812 首页轮播图下方 start -->
<div style="overflow: hidden;width: 100%;">
<div class="layout">
    <!--20160812 新增宫格菜单及广告 start-->
    <div class="channel-floor-0">
        <div class="h relative" >
            <div class="hr-16"></div>
            <a href="" target="_blank" style="position: absolute;width:1920px;top:0;left:50%;margin-left:-960px;z-index:1;*zoom:1;"  onclick="_paq.push(['trackLink','PC主站热销区背景图链接}', 'link', ' ']);ec.code.addAnalytics({hicloud:true});"><img src=""></a>
            <div class="span-240 fl relative" style="z-index:2">
                <ul class="home-channel-list">
                    
                                 <li class="top left"><a href="http://www.vmall.com/notice-657" target="_blank" onclick="_paq.push(['trackLink','PC首页功能导航_实名认证', 'link', ' ']);ec.code.addAnalytics({hicloud:true});"><img src="{{ asset('home/picture/275d661e7106517e6d32a6a503edccb0.png') }}" alt="实名认证"><span>实名认证</span></a></li>
                                <li class="top"><a href="http://www.vmall.com/recycle?url=%3Fpid%3D1032" target="_blank" onclick="_paq.push(['trackLink','PC首页功能导航_以旧换新', 'link', ' ']);ec.code.addAnalytics({hicloud:true});"><img src="{{ asset('home/picture/145ec77ebedc2532604d3b82457f586a.png') }}" alt="以旧换新"><span>以旧换新</span></a></li>
                                <li class="top"><a href="http://www.vmall.com/priority?ANONYMITY_LOGIN_NAME=lik***%40***&amp;ANONYMITY_EMAIL=lik***%40***&amp;ANONYMI" target="_blank" onclick="_paq.push(['trackLink','PC首页功能导航_优购码', 'link', ' ']);ec.code.addAnalytics({hicloud:true});"><img src="{{ asset('home/picture/9148fc18e5fe13a1e7eb66668b62bf10.png') }}" alt="优购码"><span>优购码</span></a></li>
                                 <li class="left"><a href="http://www.vmall.com/honor/remind" target="_blank" onclick="_paq.push(['trackLink','PC首页功能导航_开售提醒', 'link', ' ']);ec.code.addAnalytics({hicloud:true});"><img src="{{ asset('home/picture/83dd2782c79496d358f477981ad7710b.png') }}" alt="开售提醒"><span>开售提醒</span></a></li>
                                <li class=""><a href="{{ asset('/notice') }}" target="_blank" onclick="_paq.push(['trackLink','PC首页功能导航_公告', 'link', ' ']);ec.code.addAnalytics({hicloud:true});"><img src="{{ asset('home/picture/09506e164e078da20af2dde4f55d8df5.png') }}" alt="公告"><span>公告</span></a></li>
                                <li class=""><a href="http://www.vmall.com/privilege" target="_blank" onclick="_paq.push(['trackLink','PC首页功能导航_特权频道', 'link', ' ']);ec.code.addAnalytics({hicloud:true});"><img src="{{ asset('home/picture/93ef0510f05665c6bea5e02fc0f0e05a.png') }}" alt="特权频道"><span>特权频道</span></a></li>
                   
                </ul>
            </div>
            <div class="span-960 fr relative"  style="z-index:3">
                <ul class="home-promo-list clearfix"><li><a target="_blank" href="http://sale.vmall.com/mate9pro.html" class="item"><img src="{{ asset('home/picture/2016121420530815.jpg') }}" /></a></li><li><a target="_blank" href="http://www.vmall.com/item/573144114/index" class="item"><img src="{{ asset('home/picture/20161121142345914.jpg') }}" /></a></li><li><a target="_blank" href="http://www.vmall.com/product/3451.html" class="item"><img src="{{ asset('home/picture/2016112114234675.jpg') }}" /></a></li></ul>
            </div>
        </div>
        <!--20160812 新增宫格菜单及广告 end-->
        <!--20160812 热销推荐 start-->
<!-- 20160812-首页-热销推荐-start -->
<div class="b relative" style="z-index:5">
        <img src="" style="position: absolute;width:1920px;top:0;left:50%;margin-left:-960px;z-index:1;*zoom:1;" />
    <!--//20161123 右侧导航栏-->
    <div id="event-float-layout"
          style="position: absolute;z-index: 10;width: 100px;top: 204px; right: -105px;">
    </div>
    <div class="home-recommend-goods">
        <div class="h relative" style="z-index:4">
            <h2 class="title">热销推荐</h2>
        </div>
        <div class="b" style="z-index:5">
            <div class="goods-box">
                <ul id="testBanner" class="grid-list">
                <!-- 若推荐字段为1时，遍历所需要的数据 -->
                    @foreach ($goods as $gv)
                        @if ($gv->tuijian == 1)
                        <li class="grid-items">
                            <a class="thumb" target="_blank" href="{{ url('/details') }}/{{ $gv->goodsid }}"; >
                                <p class="grid-img"><img alt="{{ $gv->name }}" src="./uploads/{{ $gv->pic0 }}"></p>
                                <h3 class="grid-title">{{ $gv->name }}</h3>
                                <p class="grid-desc">{{ $gv->description }}</p>
                                <p class="grid-price">@if ($gv->price != ''){{ $gv->price.'元' }}@else {{ $gv->hwprice.'元' }}@endif</p>
                            </a>
                            @if ($gv->biaoqian == '新品')
                                <p class="grid-tips" style="background:#23CA43;text-align:center;line-height:18px;color:white;">
                                {{ $gv->biaoqian }}
                                </p>
                            @elseif ($gv->biaoqian == '热卖' || $gv->biaoqian == '直降' || $gv->biaoqian == '爆款')
                                <p class="grid-tips" style="background:#FF6533;text-align:center;line-height:18px;color:white;">
                                {{ $gv->biaoqian }}
                                </p>
                            @elseif ($gv->biaoqian == '首发')
                                <p class="grid-tips" style="background:#FC3784;text-align:center;line-height:18px;color:white;">
                                {{ $gv->biaoqian }}
                                </p>
                            @elseif ($gv->biaoqian == '特惠')
                                <p class="grid-tips" style="background:#00ABDF;text-align:center;line-height:18px;color:white;">
                                {{ $gv->biaoqian }}
                                </p>
                            @endif
                            
                        </li>
                        @endif
                    @endforeach      
                </ul>
            </div>
        </div>
    </div>
</div>
<!-- 20160812-首页-热销推荐-end -->       <!--20160812 热销推荐 end-->
        <div></div>

    </div>
</div>
</div>
<!-- 20160812 首页轮播图下方 end -->

<div class="hr-30"></div>
<div class="layout">
    <!-- 20160802-banner-1200*110-start -->
    <div class="home-banner">
        <!-- 20160802-banner-图片轮换-start -->
        <div class="home-banner-slideshow">
            <!-- 20130903-ad-图片轮换-start --><div class="banner-slideshow"><div id="m-banner" class="ec-slider"><ul class="ec-slider-list"><li class="ec-slider-item"><div class="ec-slider-item-img"><a href="http://www.vmall.com/product/28039329.html" onclick="_paq.push([&#39;trackLink&#39;,&#39;首页中间通栏广告第1位&#39;, &#39;link&#39;, &#39;&#39;]);ec.code.addAnalytics({hicloud:true});" target="_blank"><img src="{{ asset('home/picture/20161214215448191.jpg') }}" /></a></div></li><li class="ec-slider-item"><div class="ec-slider-item-img"><a href="http://www.vmall.com/product/885962894.html" onclick="_paq.push([&#39;trackLink&#39;,&#39;首页中间通栏广告第1位&#39;, &#39;link&#39;, &#39;&#39;]);ec.code.addAnalytics({hicloud:true});" target="_blank"><img src="{{ asset('home/picture/20161111235417403.jpg') }}" /></a></div></li></ul></div><script>
                
                ec.load("ec.slider", {
                    loadType : "lazy",
                    callback : function() { 
                        $("#m-banner").slider({
                            width: 1200, //　必须
                            height: 110, //　必须
                            style : 1, //　1显示分页，2只显示左右箭头,3两者都显示
                            pause : 5000,   //间隔时间
                            auto : true
                        });
                    }
                });
                
            </script></div>
        </div>
        <!-- 20160802-banner-图片轮换-end -->
    </div>
    <!-- 20160802-banner-1200*110-end -->
</div>
<div class="hr-40"></div>

<!-- 20160802-HOME GOOGLIST-start -->
<div class="home-channel-container">
<div class="hr-10"></div>
<!-- 初始值 -->
@foreach ($cdata as $big)
    @if ($big->name != '应用市场')
    <div class="layout relative">
        <!--//20161123 左侧导航栏-->
        <div class="home-channel-floor" id="lc_105717">
        <input type="hidden" value="{{ $gnum = 1 }}">
            <div class="h">
                @foreach ($cdata as $gcv)
                    @if ($gcv->cid == 0 && $gnum == 1 && $gcv->id == $big->id)
                        <h2 class="channel-title fl">
                            <input type="hidden" value="{{ $gcvId = $gcv->id }}">
                            {{ $gcv->name }} 
                            <input type="hidden" value="{{ $gnum++ }}">
                        </h2>
                        <ul class="channel-nav fl">
                            @foreach ($cdatas as $gcs)
                                @if ($gcs->cid == $gcvId)
                                    <li><a href="{{ url('/list') }}/{{ $gcs->id}}" target="_blank">{{ $gcs->name }}</a></li>
                                @endif
                            @endforeach
                        </ul>
                    @endif
                @endforeach

                <div class="channel-more fr"><span></span><span></span><span></span>
                    <a href="/list/{{ $big->id }}" target="_blank">更多</a><span></span><span></span><span></span>
                </div>
            </div>
            <div class="b">
                <!--20160815 广告 start-->
                <div class="span-232 fl">
                    <ul class="grid-promo-list">
                        <!--20160815 大广告 start-->
                        <!-- 遍历每个一级分类下的大图 -->
                        @foreach ($gcdatas as $gcdatasV)
                            @if ($gcdatasV->cid == 0 && $gcdatasV->id == $big->id)
                                @if ($gcdatasV->img == '')
                                    <li class="grid-items grid-items-lg">
                                        <a class="thumb" href="#" target="_blank">
                                            <img src="./uploads/{{ $gcdatasV->images }}" alt="" />
                                        </a>
                                    </li>
                                @else
                                    <li class="grid-items grid-items-md">
                                        <a class="thumb" href="#" target="_blank">
                                            <img src="./uploads/{{ $gcdatasV->images }}" alt="" />
                                        </a>
                                    </li>
                                    <li class="grid-items grid-items-md">
                                        <a class="thumb" href="#" target="_blank">
                                            <img src="./uploads/{{ $gcdatasV->img }}" alt="" />
                                        </a>
                                    </li>
                                @endif
                            @endif
                        @endforeach
                    </ul>
                </div>
                <!--20160815 广告 end-->
                <div class="span-968 fl">
                    <ul class="grid-list">
                        <!--通过添加current 来实现 hover效果-->
                        <!--通过添加current 来实现 hover效果-->
                        <!-- 设一个变量$gvname用来限制名称是否能重复遍历 -->
                        {{ $gvname = '' }}
                        <!-- 设一个变量$Number用来限制遍历几个商品 -->
                        <input type="hidden" value="{{ $Number = 1}}"> 
                        @foreach ($goods as $gv)
                            <!-- 设一个变量$numTwo用来限制遍历1次 -->
                            <input type="hidden" value="{{ $numTwo = 1}}">
                            <!-- 如果$gvname不等于上一次的商品名称 且 将数据只取前8条 且 推荐为0 且 商品表的cid等于商品分类表的id -->
                            @if($gvname != $gv->name && $Number <= 8)
                                @if ($gv->tuijian == 0 && $numTwo == 1 && $gv->cid == $gcvId)

                                    <li class="grid-items" style="height: 280px;">
                                        <a class="thumb" href="{{ url('/details') }}/{{ $gv->goodsid }}" target="_blank">

                                            <p class="grid-img">
                                                <img src="./uploads/{{ $gv->pic0 }}" alt="{{ $gv->name }}" />
                                            </p>
                                            <h3 class="grid-title">{{ $gv->name }}</h3>
                                            <p class="grid-desc">{{ $gv->description }}</p>
                                            <p class="grid-price"><em>&yen;</em><span>@if ($gv->price != ''){{ $gv->price }}@else {{ $gv->hwprice }}@endif</span></p>
                                            @if ($gv->biaoqian == '新品')
                                                <p class="grid-tips" style="background:#23CA43;text-align:center;line-height:18px;color:white;">
                                                {{ $gv->biaoqian }}
                                                </p>
                                            @elseif ($gv->biaoqian == '热卖' || $gv->biaoqian == '直降' || $gv->biaoqian == '爆款')
                                                <p class="grid-tips" style="background:#FF6533;text-align:center;line-height:18px;color:white;">
                                                {{ $gv->biaoqian }}
                                                </p>
                                            @elseif ($gv->biaoqian == '首发')
                                                <p class="grid-tips" style="background:#FC3784;text-align:center;line-height:18px;color:white;">
                                                {{ $gv->biaoqian }}
                                                </p>
                                            @elseif ($gv->biaoqian == '特惠')
                                                <p class="grid-tips" style="background:#00ABDF;text-align:center;line-height:18px;color:white;">
                                                {{ $gv->biaoqian }}
                                                </p>
                                            @endif
                                        </a>
                                    </li>
                                    <input type="hidden" value="{{ $numTwo++ }}"> 
                                    <input type="hidden" value="{{ $gvname = $gv->name}}"> 
                                    <input type="hidden" value="{{ $Number++ }}"> 
                                @endif
                            @endif
                        @endforeach
                    </ul>
                </div>
            </div>
        </div>
    </div>
    @endif
@endforeach
    <div class="hr-20"></div>
    <div class="layout">
        <div class="ec-slider-item-img">
            <!-- 20130903-ad-762*132-start --><div class="ad fl"><a target="_blank" href="http://www.vmall.com/notice-657"><img src="{{ asset('home/picture/20160923092437178.jpg') }}" title="实名认证" style="float:none;" /></a></div><!-- 20130903-ad-762*132-end -->
        </div>
    </div>
    <div class="hr-20"></div>
</div>

<textarea id="top-banner" class="hide">
    <!-- 顶部banner -->
    <div class="top-banner-max hide" id="top-banner-max">
        <div class="top-banner-img">
            
            <a title="折叠" href="javascript:;" class="button-top-banner-min" id="top-banner-max-toggle">-</a>
        </div>
    </div>
    <div class="top-banner-min hide" id="top-banner-min">
        <div class="top-banner-img">
            
            <a title="展开" href="javascript:;" class="button-top-banner-max hide" id="top-banner-min-toggle">+</a>
            <a class="button-top-banner-close" href="javascript:;" title="关闭" id="top-banner-min-close" onclick="javascript:$('#top-banner-block').hide(); ec.index.floatLayout(); ec.index.floatLayout('left');">关闭</a>
        </div>
    </div>
    <!-- 顶部banner end -->
</textarea>

<script>
 // 改为异步调用
</script>

<!-- 20160802-banner-hover效果 简易-end -->
<script>
    (function () {
        $('.home-channel-container .grid-items').hover(function () {
            $(this).addClass('current')
        }, function () {
            $(this).removeClass('current')

        })
    })()
</script>

<script src="{{ asset('home/js/index.min.js') }}"></script>
<script>
(function (_ec) {
//顶部banner
    _ec.bigAd = false;
    _ec.smallAd = false;
    _ec.bigadShowTime = 8000;
    _ec.now = new Date().format('yyyy-MM-dd HH:mm:ss');
    
    _ec.configNowTime = function(){
        if(_serverTime)
        {
            _ec.now = new Date(_serverTime).format('yyyy-MM-dd HH:mm:ss');
        }
    }
    
    ec.load({
        url : "/serverTime.jsp?"+(new Date()).getTime(),
        type : "js",
        loadType:"lazy",
        onload : _ec.configNowTime
    });
})(ec.index);
</script>

@endsection
@section('bottom')
@include('home.links')
@endsection